package com.wgy.day20.发红包练习;

import java.util.ArrayList;
//红包派分接口的实现类,平均分配
public class NormalMode implements OpenMode{
    @Override
    public ArrayList<Integer> divide(int totalMoney, int totalCount) {
        ArrayList<Integer> list=new ArrayList<>();//创建红包集合
        int avg=totalMoney/ totalCount;//平均数
        int mod=totalMoney% totalCount;//零头
        for (int i = 0; i < totalCount-1; i++) {
            list.add(avg);
        }
        list.add(avg+mod);

        return list;
    }
}
